package com.ybt.communicate.tcp.configration;

import com.ybt.communicate.tcp.accessor.IDataAccessStrategy;

public class TCPRuntimeConfig {
    private TCPProtocolConfig staticConfig;
    private int workThread;
    private int readTimeout;
    private int connTimeout;
    private String ip;
    private int port;
    private boolean duplex;
    private boolean longMode;
    private IDataAccessStrategy readAccessor;
    private IDataAccessStrategy writeAccessor;
    public TCPRuntimeConfig(TCPProtocolConfig staticConfig) {
        super();
        this.staticConfig = staticConfig;
    }
    public TCPProtocolConfig getStaticConfig() {
        return staticConfig;
    }
    public void setStaticConfig(TCPProtocolConfig staticConfig) {
        this.staticConfig = staticConfig;
    }
    public int getWorkThread() {
        return workThread;
    }
    public void setWorkThread(int workThread) {
        this.workThread = workThread;
    }
    
    public String getProtocolMode() {
        // TODO Auto-generated method stub
        return staticConfig.getProtocolMode();
    }

    public String getIODirection() {
        return staticConfig.getIODirection();
    }

    public boolean isServerSide() {
        return staticConfig.isServerSide();
    }
    
    public boolean isLongMode() {
        return longMode;
    }
    public void setLongMode(boolean longMode) {
        this.longMode = longMode;
    }
    public int getReadTimeout() {
        return readTimeout;
    }
    public int getConnTimeout() {
        return connTimeout;
    }
    public IDataAccessStrategy getReadAccessor() {
        return readAccessor;
    }
    public void setReadAccessor(IDataAccessStrategy accessor) {
        this.readAccessor = accessor;
    }
    
    public String getProtocolType() {
        return staticConfig.getProtocolType();
    }

    public String getProtocolId() {
        return staticConfig.getProtocolId();
    }

    public IDataAccessStrategy getWriteAccessor() {
        return writeAccessor;
    }
    public void setWriteAccessor(IDataAccessStrategy accessor) {
        this.writeAccessor = accessor;
    }
    public boolean isDuplex() {
        // TODO Auto-generated method stub
        return duplex;
    }
    public void setDuplex(boolean duplex) {
        // TODO Auto-generated method stub
        this.duplex = duplex;
    }
    
    public String getIp() {
        return ip;
    }
    public void setIp(String ip) {
        this.ip = ip;
    }
    public int getPort() {
        return port;
    }
    public void setPort(int port) {
        this.port = port;
    }
    public void setReadTimeout(int readTimeout) {
        this.readTimeout = readTimeout;
    }
    public void setConnTimeout(int connTimeout) {
        this.connTimeout = connTimeout;
    }
}
